/*
 * @file    :drv_uart.h
 * @author  :LingFengLu
 * @date    :2023-06-06
 */

#ifndef _DRV_UART_H_
#define _DRV_UART_H_
#include "global.h"
//Constant definition    宏定义

typedef enum
{
	DRV_UART_DEVICE_ID_1 = 0,
	DRV_UART_DEVICE_ID_2,
	DRV_UART_DEVICE_ID_3,
	DRV_UART_COUNT_DEVICE_ID
} drv_uart_device_id;


#define BSP_UART_TX_PIN                           LL_GPIO_PIN_1
#define BSP_UART_TX_GPIO_PORT                     GPIOA
#define BSP_UART_TX_GPIO_AF_N                     LL_GPIO_AF_2
#define BSP_UART_TX_GPIO_AF()                     LL_GPIO_SetAFPin_0_7(BSP_UART_TX_GPIO_PORT, BSP_UART_TX_PIN, BSP_UART_TX_GPIO_AF_N)
#define BSP_UART_TX_GPIO_CLK_ENABLE()             LL_AHB_EnableClock(LL_AHB_PERIPH_GPIOA)
#define BSP_UART_TX_GPIO_CLK_DISABLE()            LL_AHB_DisableClock(LL_AHB_PERIPH_GPIOA)

#define BSP_UART_RX_PIN                           LL_GPIO_PIN_0
#define BSP_UART_RX_GPIO_PORT                     GPIOB
#define BSP_UART_RX_GPIO_AF_N                     LL_GPIO_AF_0
#define BSP_UART_RX_GPIO_AF()                     LL_GPIO_SetAFPin_0_7(BSP_UART_RX_GPIO_PORT, BSP_UART_RX_PIN, BSP_UART_RX_GPIO_AF_N)
#define BSP_UART_RX_GPIO_CLK_ENABLE()             LL_AHB_EnableClock(LL_AHB_PERIPH_GPIOB)
#define BSP_UART_RX_GPIO_CLK_DISABLE()            LL_AHB_DisableClock(LL_AHB_PERIPH_GPIOB)
#define BSP_USART_RX_WAKEUP                       WAKEUP_PB0

//Type definition    类型定义


//Function declaration    函数申明
void DrvUart_Init(uint ui_DeviceID) ;
void DrvUart_SendByte
(
uint ui_DeviceID ,
    uint8 u8_Byte
);
void DrvUart_WaitSendFinish(uint ui_DeviceID);
void DrvUart_DeInit(uint ui_DeviceID);
void DrvUart_SendData
(
uint ui_DeviceID ,
uint8 * u8p_Data,
uint16 u16_Len
);

//Golbal variable declaration   全局变量申明










#endif

